package com.changgou.order.feign;

import com.changgou.entity.Result;
import com.changgou.order.pojo.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * @Author: HuangFu
 * @Date: 2020/2/15 19:55
 * @Description:
 */
@FeignClient(name ="order")
public interface OrderFeign {
    /**
     * 添加订单
     * @param order
     * @return
     */
    @PostMapping("/order")
    Result add(Order order);

    /**
     * 查询订单
     * @param id
     * @return
     */
    @GetMapping("/order/{id}")
    Result<Order> findById(@PathVariable String id);
}
